import {createBrowserRouter} from 'react-router-dom'
import Layout from "@/pages/Layout";
import Years from "@/pages/Years";
import Month from "@/pages/Month";
import News from "@/pages/news";
import NotFound from "@/pages/NotFound";

// 创建路由实例 给组件绑定path
const router = createBrowserRouter([
        {
            path: '/',
            element: <Layout/>,
            children: [
                {
                    path: 'years',
                    element: <Years/>
                },
                {
                    path: 'month',
                    element: <Month/>
                }
            ]
        },
        {
            path: '/news',
            element: <News/>
        },
        {
            path: '*',
            element: <NotFound/>
        }
    ]
)
export default router